package com.zhf.server.util;

import java.util.ArrayList;
import java.util.Random;

public class CommonUtil {
    public static ArrayList<Integer> generateFiveNum(int n){
        ArrayList<Integer> integers = new ArrayList<>();
        int count = 0;
        Random random = new Random();
        while (count < 5){
            int temp = random.nextInt(n);
            if(!integers.contains(temp)){
                integers.add(temp);
                count++;
            }
        }
        return integers;
    }
}
